package sort;

import junit.framework.TestCase;
import sort.record.Record;
import sort.record.Records;

public class CheckUtilTest extends TestCase {

	public CheckUtilTest(String name) {
		super(name);
	}

	protected void setUp() throws Exception {
		super.setUp();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testIsStabled() {
		Records recs1 = new Records();
		recs1.add(new Record(1,"aaaa"));
		recs1.add(new Record(1,"bbbb"));
		recs1.add(new Record(2,"ccccc"));
		
		Records recs2 = recs1.copy();
		
		assertTrue(CheckUtil.isStabled(recs1, recs2));
		
		recs2 = new Records();
		recs2.add(new Record(1,"bbbb"));
		recs2.add(new Record(1,"aaaa"));
		recs2.add(new Record(2,"ccccc"));
		
		assertFalse(CheckUtil.isStabled(recs1, recs2));
		
	}

}
